package com.neibu.hw4;

import java.util.Arrays;

/**
 * @author bin
 * @date 2025 - 04 -02
 **/
public class MainTest {
    public static void main(String[] args) {
        Student stu01 = new Student("张三", 18);
        Student stu02 = new Student("李四", 19);
        Student stu03 = new Student("王五", 20);
        Student stu04 = new Student("赵六", 21);
        Student[] students = {stu01, stu02, stu03, stu04};
        Arrays.sort(students, (o1,o2)->o1.getAge()-o2.getAge());


        System.out.println(Arrays.toString(students));
    }
}
